package org.chaiyi.template.core.common.util.asserts;

import java.util.Date;

public class DateAssert {
    private final Date value;

    DateAssert(Date value) {
        this.value = value;
    }

    public boolean lt(Date value) {
        return this.value.getTime() < value.getTime();
    }

    public boolean lte(Date value) {
        return this.value.getTime() <= value.getTime();
    }

    public boolean gte(Date value) {
        return this.value.getTime() >= value.getTime();
    }

    public boolean gt(Date value) {
        return this.value.getTime() > value.getTime();
    }

    public boolean in(Date from, Date to) {
        return this.gte(from) && this.lte(to);
    }

    public boolean timeRange(Date from, Date to) {
        return this.gte(from) && this.lt(to);
    }
}